<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<!DOCTYPE html>
<html:html lang="true">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title><bean:message key="welcome.title"/></title>
        <link href="css/mini3537.css?files=reset,common,form,standard,960.gs.fluid,simple-lists,block-lists,planning,table,calendars,wizard,gallery" rel="stylesheet" type="text/css">
        <link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
        <link rel="icon" type="image/png" href="favicon-large.png">
        <script type="text/javascript" src="js/miniab15.php?files=html5,jquery-1.4.2.min,old-browsers,jquery.accessibleList,searchField,common,standard,jquery.tip,jquery.hashchange,jquery.contextMenu,list"></script>
        <html:base/>


    </head>
    <body >
        <%@ include file="/Header.jsp"%>

        <!-- ####################                  Vertical Menu                    ########################## -->
        <%@ include file="/verticalmenu.jsp"%>

        <!-- ####################                  Vertical Menu                    ########################## -->

        <!-- *************************************** Content *************************************************** -->
    <section class="grid_9">
        <div class="block-border"><div class="block-content">
                <!-- We could put the menu inside a H1, but to get valid syntax we'll use a wrapper -->
                <div class="h1 with-menu">
                    <h1>Web stats</h1>
                    <div class="menu">
                        <img src="images/menu-open-arrow.png" width="16" height="16">
                        <ul>
                            <li class="icon_address"><a href="#">Browse by</a>
                                <ul>
                                    <li class="icon_blog"><a href="#">Blog</a>
                                        <ul>
                                            <li class="icon_alarm"><a href="#">Recents</a>
                                                <ul>
                                                    <li class="icon_building"><a href="#">Corporate blog</a></li>
                                                    <li class="icon_newspaper"><a href="#">Press blog</a></li>
                                                </ul>
                                            </li>
                                            <li class="icon_building"><a href="#">Corporate blog</a></li>
                                            <li class="icon_computer"><a href="#">Support blog</a></li>
                                            <li class="icon_search"><a href="#">Search...</a></li>
                                        </ul>
                                    </li>
                                    <li class="icon_server"><a href="#">Website</a></li>
                                    <li class="icon_network"><a href="#">Domain</a></li>
                                </ul>
                            </li>
                            <li class="icon_export"><a href="#">Export</a>
                                <ul>
                                    <li class="icon_doc_excel"><a href="#">Excel</a></li>
                                    <li class="icon_doc_csv"><a href="#">CSV</a></li>
                                    <li class="icon_doc_pdf"><a href="#">PDF</a></li>
                                    <li class="icon_doc_image"><a href="#">Image</a></li>
                                    <li class="icon_doc_web"><a href="#">Html</a></li>
                                </ul>
                            </li>
                            <li class="sep"></li>
                            <li class="icon_refresh"><a href="#">Reload</a></li>
                            <li class="icon_reset">Reset</li>
                            <li class="icon_search"><a href="#">Search</a></li>
                            <li class="sep"></li>
                            <li class="icon_terminal"><a href="#">Custom request</a></li>
                            <li class="icon_battery"><a href="#">Stats server load</a></li>
                        </ul>
                    </div>
                </div>

                <div class="block-controls">

                    <ul class="controls-tabs js-tabs same-height with-children-tip">
                        <li><a href="#tab-stats" title="Charts"><img src="images/icons/web-app/24/Bar-Chart.png" width="24" height="24"></a></li>
                        <li><a href="#tab-comments" title="Comments"><img src="images/icons/web-app/24/Comment.png" width="24" height="24"></a></li>
                        <li><a href="#tab-medias" title="Medias"><img src="images/icons/web-app/24/Picture.png" width="24" height="24"></a></li>
                        <li><a href="#tab-users" title="Users"><img src="images/icons/web-app/24/Profile.png" width="24" height="24"></a></li>
                        <li><a href="#tab-infos" title="Informations"><img src="images/icons/web-app/24/Info.png" width="24" height="24"></a></li>
                    </ul>

                </div>

                <html:form styleClass="form" styleId="land"  action="land.do">

                    <fieldset class="grey-bg">
                        <legend><a href="#">Options</a></legend>

                        <div class="float-left gutter-right">
                            <label for="stats-period">Land Name</label>
                            <span class="input-type-text">
                                <html:text  property="name" styleId="nameland" />
                            </span>
                        </div>
                        <div class="float-left gutter-right">
                            <label for="stats-period">Address</label>
                            <span class="input-type-text">
                                <html:text  property="address" styleId="addressland"/>
                            </span>
                        </div>
                        <div class="float-left gutter-right">
                            <label for="stats-period">Square</label>
                            <span class="input-type-text" >
                                <html:text  property="square" styleId="squareland" />
                            </span>
                        </div>



                        <div class="float-left gutter-right">
                            <br>
                            <span class="label">Status</span>
                            <p class="input-height grey-bg">
                                <html:checkbox property="buildingPermit" value="true"  styleId="BuildingPermit" />&nbsp;<label for="stats-display-0">BuildingPermit</label>
                                <html:checkbox property="occupancyPermit" value="true" styleId="OccupancyPermit" />&nbsp;<label for="stats-display-1">OccupancyPermit</label>
                            </p>
                        </div>
                        <div class="float-left gutter-right">
                            <br>
                            <span class="input-type-text">
                                <label for="stats-period">Note</label>
                                <html:textarea property="note" styleId="noteland"  style="margin-left: 2px; margin-right: 2px; width: 497px; margin-top: 2px; margin-bottom: 2px; height: 98px; " /> </span>
                        </div>
                    </fieldset>
                    <ul class="message no-margin">
                       
                        <button type="button" class="red" onclick="cancel()">Cancel</button>
                        <button type="reset" class="grey">Reset</button>
                        <button type="button" onclick="saveUser()" id="buttomsave"><img src="images/icons/fugue/tick-circle.png" width="16" height="16"> Save</button>
                    </ul>
                </html:form>

            </div></div>
    </section>



    <!-- *************************************** Content *************************************************** -->
</article>
<!--Footer-->
<%@ include file="/Footer.jsp"%>
<!-- Footer -->
</body>
</html:html>
<script type="text/javascript"  language="javascript">

    function loadForm(){
    	var type = '<%=(String) request.getAttribute("type")%>';
        BuildingPermit = '<%=(String) request.getAttribute("BuildingPermit")%>';
        OccupancyPermit = '<%=(String) request.getAttribute("OccupancyPermit")%>';
       if(type == "detail"){
           document.getElementById("nameland").disabled=true;
           document.getElementById("addressland").disabled=true;
           document.getElementById("squareland").disabled=true;
           document.getElementById("BuildingPermit").disabled=true;
           document.getElementById("OccupancyPermit").disabled=true;
           document.getElementById("noteland").disabled=true;
           document.getElementById("buttomsave").disabled=true;
       }

       if(BuildingPermit == "1")
           document.getElementById("BuildingPermit").checked = true;
        else 
           document.getElementById("BuildingPermit").checked= false;
       
       if(OccupancyPermit == "1")
           document.getElementById("OccupancyPermit").checked= true;
       else
           document.getElementById("OccupancyPermit").checked= false;
    }
    
    
    var type = '<%=(String) request.getAttribute("type")%>';
    id = '<%=(String) request.getAttribute("id")%>';
    function saveUser()
    {
        if(type=='add'){
            document.getElementById("land").action = 'land.do?method=addLand&type=add';
            document.getElementById("land").submit();
        }else{
            document.getElementById("land").action = 'land.do?method=editLand&type=edit&id='+ id
            document.getElementById("land").submit();
        }


    }

    function cancel(){
        document.getElementById("land").action = 'land.do?method=getAllLand'
        document.getElementById("land").submit();
    }


</script>